<template>
  <!-- 即时转账排队明细 -->
  <el-dialog :title="title" center :visible.sync="openState" width="1024px" :close-on-click-modal="false">
    <el-form ref="editForm" :model="form"  label-width="150px" disabled>
      <!--交易础信息-->
      <el-card class="form-card">
        <div slot="header" class="label-header-msg">
          <span>交易基础信息</span>
        </div>
        <el-row>
          <el-col :span="8">
            <el-form-item label="报文标识号" prop="pkgId">
              <el-input v-model="form.pkgId" />
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="交易流水号" prop="id">
              <el-input v-model="form.id" />
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="原即时转账报文标识号" prop="oriPkgId">
              <el-input v-model="form.oriPkgId" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="8">
            <el-form-item label="系统编号" prop="sysCode">
              <el-select style="width: 100%;" v-model="form.sysCode" placeholder="系统编号">
                <el-option
                  v-for="dict in dictMap.SYSTEMCODE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="来往标识" prop="drct">
              <el-select style="width: 100%;" v-model="form.drct" placeholder="来往标识">
                <el-option
                  v-for="dict in dictMap.DRCTCODE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="8">
            <el-form-item label="交易渠道" prop="source">
              <el-select style="width: 100%;" v-model="form.source" placeholder="柜面交易">
                <el-option
                  v-for="dict in dictMap.TXN_SOURCE"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>


        <el-row>
          <el-col :span="8">
            <el-form-item label="内部机构号" prop="brno">
              <el-select style="width: 100%;" v-model="form.brno" placeholder="内部机构号">
                <el-option
                  v-for="dict in dictMap['Cnaps2Dict.CP2_BRNO']"
                  :key="dict.value"
                  :label="`${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="工作日期" prop="workdate">
              <el-date-picker v-model="form.workdate" style="width: 100%" type="date" value-format="yyyyMMdd" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="业务类型" prop="bizTypeCode">
              <el-select style="width: 100%;" v-model="form.bizTypeCode" placeholder="业务类型">
                <el-option
                  v-for="dict in dictMap['Cnaps2Dict.BIZ_TYPE_141']"
                  :key="dict.value"
                  :label="`${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="业务种类" prop="bizCtgyCode">
              <el-select style="width: 100%;"
                         v-model="form.bizCtgyCode===null||form.bizCtgyCode===undefined?'':form.bizCtgyCode+'-'+form.bizCtgyCodeDesc"
                         placeholder="业务种类" :disabled="true"
              >

              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="通知类型" prop="noticeType">
              <el-select style="width: 100%;" v-model="form.noticeType" placeholder="通知类型">
                <el-option
                  v-for="dict in dictMap['Cnaps2Dict.NOTICETYPE']"
                  :key="dict.value"
                  :label="`${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-col :span="8">
            <el-form-item label="交易币种" prop="curcd">
              <el-input v-model="form.curcd" placeholder="货币种类" :disabled="true"  />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="金额" prop="amount">
              <ht-amount-input v-model="form.amount" placeholder="交易金额" ></ht-amount-input>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="大写金额" prop="bAmount">
              <ht-amount-upper :inputValue="form.amount" placeholder="交易金额" ></ht-amount-upper>
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <!--付款人信息-->
      <el-card class="form-card">
        <div slot="header" class="label-header-msg">
          <span>付款人信息</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="付款人账号" prop="payerActno">
              <el-input v-model="form.payerActno" placeholder="付款人账号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="付款行行号" prop="payerBrno">
              <el-input v-model="form.payerBrno" placeholder="付款行行号" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-form-item label="付款人名称" prop="payerName">
            <el-input v-model="form.payerName" placeholder="付款人名称" />
          </el-form-item>
        </el-row>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payer">
              <el-form-item label="付款人开户行号" prop="payerAccBrno">
                <el-input v-model="form.payerAccBrno" placeholder="付款人开户行行号" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form-item label="付款人开户行行名" prop="payerAccBrname" label-width="130px">
              <el-input v-model="form.payerAccBrname" placeholder="付款人开户行行名" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <!--收款人信息-->
      <el-card class="form-card">
        <div slot="header" class="label-header-msg">
          <span>收款人信息</span>
        </div>
        <el-row :gutter="10">
          <el-col :span="12">
            <el-form-item label="收款人账号" prop="payeeActno">
              <el-input v-model="form.payeeActno" placeholder="收款人账号" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="收款行行号" prop="payeeBrno">
              <el-input v-model="form.payeeBrno" placeholder="收款行行号" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="收款人名称" prop="payeeName">
          <el-input v-model="form.payeeName" placeholder="收款人名称" />
        </el-form-item>
        <el-row :gutter="10">
          <el-col :span="8">
            <div class="grid-payee">
              <el-form-item label="收款人开户行号" prop="payeeAccBrno">
                <el-input v-model="form.payeeAccBrno" placeholder="收款人开户行行号" />
              </el-form-item>
            </div>
          </el-col>
          <el-col :span="16">
            <el-form-item label="收款人开户行行名" prop="payeeAccBrname" label-width="130px">
              <el-input v-model="form.payeeAccBrname" placeholder="收款人开户行行名" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-card>

      <el-card class="form-card txnInfo-card">
        <div slot="header" class="label-header-msg">
          <span>其他信息</span>
        </div>
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="特许参与者行号" prop="espOrg">
              <el-input v-model="form.espOrg" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="特许参与者名称" prop="espOrgname">
              <el-input v-model="form.espOrgname" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="交易批次号" prop="txnBatchno">
              <el-input v-model="form.txnBatchno" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="通讯状态" prop="status">
              <el-select style="width: 100%;" v-model="form.status" placeholder="通讯状态">
                <el-option
                  v-for="dict in dictMap.PKG_STATUS"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row>
          <el-col :span="12">
            <el-form-item label="中心状态" prop="procStatus">
              <el-select style="width: 100%;" v-model="form.procStatus" placeholder="中心状态">
                <el-option
                  v-for="dict in dictMap.PROCESSSTATUS"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="报文接收时间" prop="rcvTime">
              <el-date-picker style="width: 100%;" v-model="form.rcvTime" value-format="yyyyMMddHHmmss"
                              type="datetime"
              />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="通用处理码" prop="procCode">
              <el-input v-model="form.procCode" />
            </el-form-item>
          </el-col>
        </el-row>


      </el-card>
    </el-form>
    <div slot="footer" class="dialog-footer">
      <el-button @click="close">关闭</el-button>
    </div>
  </el-dialog>
</template>
<script>
import { detail, approve, reject } from "@/api/cnaps/baseBiz/inquire/141/index";
import CardForm from "@/views/components/CardForm";
import HtAmountInput from "@/views/components/HtAmountInput";
import HtAmountUpper from "@/views/components/HtAmountUpper";

export default {
  name: "EditInfo",
  components: {
    HtAmountInput,
    HtAmountUpper
  },
  props: {
    dictMap: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {
      cardList: [],
      busTypeList: [],
      id: "",
      title: "",
      msgType: "",
      // 是否显示弹出层
      openState: false,
      // 表单参数
      form: {
        amount: "0.00",
      },
    };
  },
  watch: {
    dictMap: {
      handler(data) {},
    },
  },

  methods: {
    // 表单重置
    reset() {
      // this.resetForm("editForm");
      this.$set(this, "form", {});
    },
    close() {
      this.reset();
      this.openState = false;
    },
    // 关闭回掉


    show(row = {}) {
      let that = this;
      this.title = "即时转账排队/撤销通知查询 详情";
      let tempForm = row;
      this.$set(this, "form", row);
      this.openState = true;
    },
    cancel() {
      this.openState = false;
      this.reset();
      this.$emit("editComplete", false);
    },
  },
};
</script>
<style>
.label-header-msg {
  font-weight: bold;
}

.form-card {
  margin-bottom: 10px;
}
</style>
